import Mock from 'mockjs'
import data from './modules/training/data.json'
import mycreate from './modules/training/create.json'
import json from './modules/training/join.json'
import course from './modules/training/course.json'
import history from './modules/training/history.json'
import userInfoData from './modules/center/userInfo.json'
import memberData from './modules/center/member.json'
import information from './modules/center/informaTion.json'
import saveInfo from './modules/center/saveInfo.json'
import detail from './modules/training/detail.json'
Mock.mock('/mock/trainingCenter',()=>{
    return{
        code:200,
        data,
        message: 'success',
    }
})
Mock.mock('/mock/my_create', () => {
    return {
        code: 200,
        data: mycreate,
        message: 'success',
    }
})
Mock.mock('/mock/my_join', () => {
    return {
        code: 200,
        data: json,
        message: 'success',
    }
})
Mock.mock('/mock/my_course', () => {
    return {
        code: 200,
        data: course,
        message: 'success',
    }
})
Mock.mock('/mock/viewRecords', () => {
    return {
        code: 200,
        data: history,
        message: 'success',
    }
})

// 个人信息
Mock.mock('/mock/getInfo',()=>{
    return{
        code: 200,
        data: userInfoData,
        message: 'success'
    }
})
// 会员信息
Mock.mock('/mock/getMember',()=>{
    return{
        code: 200,
        data: memberData.data,
        message: 'success'
    }
})
// 个人资料信息
Mock.mock('/mock/getInformation',()=>{
    return{
        code: 200,
        data: information.data,
        message: 'success'
    }
})
// 保存修改个人信息
Mock.mock('/mock/save',()=>{
    return{
        code: 200,
        data: saveInfo,
        message: 'success'
    }
})
Mock.mock('/mock/detail',()=>{
    return{
        code:200,
        data:detail,
        message:'success'
    }
})


// 这个文件用来使用mock模拟数据
// 1. 下载安装
// npm i mockjs
// 2.引入使用

const addressList = [
    {
        id: 2254,
        userAddress: '北京宏福苑小区6号楼202',
        userId: 2,
        provinceId: 6,
        consignee: '强哥',
        phoneNum: '13999999999',
        isDefault: '0',
        regionId: 2,
        fullAddress: '北京宏福苑小区6号楼202',
    },
    {
        id: 2255,
        userAddress: '123',
        userId: 2,
        provinceId: 1,
        consignee: '232',
        phoneNum: '123',
        isDefault: '0',
        regionId: 1,
        fullAddress: '北京123',
    },
    {
        id: 2257,
        userAddress: '武汉科技大学',
        userId: 2,
        provinceId: 24,
        consignee: '李华',
        phoneNum: '12345678910',
        isDefault: '1',
        regionId: 4,
        fullAddress: '湖北武汉科技大学',
    },
]

Mock.mock('/mock/user/userAddress/auth/findUserAddressList', function () {
    return {
        code: 200,
        data: addressList,
        message: 'success',
    }
})
